﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MarvinsArena.Core;
using Microsoft.Xna.Framework;

namespace BattleEngineCommon
{
	public class Robot : IRobot
	{

        public string Name { get; set; }
        public double PositionX { get { return this.RobotHost.PositionX; } set { this.RobotHost.PositionX = value; } }
        public double PositionY { get { return this.RobotHost.PositionY; } set { this.RobotHost.PositionY = value; } }
        public double Radius { get; set; }
        public double Rotation { get { return this.RobotHost.Rotation; } set { this.RobotHost.Rotation = value; } }
        public TypeWorldObjects TypeWorldObject { get { return TypeWorldObjects.Robot; } }

        public RobotHost RobotHost { get; set; }
        public double RotationGun { get { return this.RobotHost.RotationGun; } set { this.RobotHost.RotationGun = value; } }
        public double RotationRadar { get { return this.RobotHost.RotationRadar; } set { this.RobotHost.RotationRadar = value; } }
        public int SquadNumber { get { return this.RobotHost.SquadNumber; } set { this.SquadNumber = value; } }
        public int Team { get { return this.RobotHost.Team; } set { this.Team = value; } }
        public string FullName { get { return String.Format("{0} {1}.{2}", this.RobotHost.Name, this.RobotHost.Team, this.RobotHost.SquadNumber); } set { this.FullName = value; } }
        public int Hitpoints { get { return this.RobotHost.Hitpoints; } set { this.Hitpoints = value; } }
        public int Missiles { get { return this.RobotHost.Missiles; } set { this.Missiles = value; } }
        public int Heat { get { return this.RobotHost.Heat; } set { this.Heat = value; } }
        public bool IsActive { get { return this.RobotHost.IsActive; } set { this.IsActive = value; } }
        public string DisabledMessage { get { return this.RobotHost.DisabledMessage; } set { this.DisabledMessage = value; } }
		public Color TeamColor { get { return SetColor(); } }

		private Color SetColor()
		{
			switch (this.Team)
			{
				case 1: return Color.Red;      // Red
				case 2: return Color.Blue;      // Blue
				case 3: return  Color.Green;      // Green
				case 4: return Color.FromNonPremultiplied(153, 31, 54,0);    // Arizona Cardinals Red
				case 5: return Color.FromNonPremultiplied(247, 181, 18,0);   // AC Yellow
				case 6: return Color.FromNonPremultiplied(0, 115, 54, 0);     // Celtic Green
				case 7: return Color.FromNonPremultiplied(0, 51, 171, 0);     // Buffalo Bills Royal Blue
				case 8: return Color.FromNonPremultiplied(156, 31, 46, 0);    // Kansas City Chiefs Red
				case 9: return Color.FromNonPremultiplied(36, 87, 69, 0);     // Green Bay
				case 10: return Color.FromNonPremultiplied(186, 18, 43, 0);   // Atlanta Falcons Red
				case 11: return Color.FromNonPremultiplied(217, 79, 0, 0);    // Clevland Browns Orange
				case 12: return Color.FromNonPremultiplied(181, 179, 140, 0); // Clevland Browns Champangne
				case 13: return Color.FromNonPremultiplied(115, 133, 140, 0); // Dallas Cowboys Metallic Silver Blue
				default: return Color.FromNonPremultiplied(255, 255, 255, 0); // Black
			}
		}

	}
}
